The 'destroy' signal currently doesn't work with connectObject(),
because the handler is only connected after the signal tracker's
own destroy handler, which disconnects all handlers.
Address this by using connect_after for the cleanup handler, so
that other destroy handlers run before it (unless they also use
ConnectFlags.AFTER, but well *shrug*).
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2221>
*/
constructor(owner) {
if (this._hasDestroySignal(owner))
- this._ownerDestroyId = owner.connect('destroy', () => this.clear());
+ this._ownerDestroyId = owner.connect_after('destroy', () => this.clear());
this._owner = owner;
this._map = new Map();
const signalData = this._getSignalData(obj);
if (signalData.destroyId)
return;
- signalData.destroyId = obj.connect('destroy', () => this.untrack(obj));
+ signalData.destroyId = obj.connect_after('destroy', () => this.untrack(obj));
}
_disconnectSignal(obj, id) {